
<html><HEAD>
<LINK REL=STYLESHEET HREF="default.css" TYPE="text/css">
<TITLE>
Modifying source-controlled targets and objects</TITLE>
</HEAD>
<BODY>

<!-- Header -->
<p class="ancestor" align="right"><A HREF="pbugp28.htm">Previous</A>&nbsp;&nbsp;<A HREF="pbugp30.htm" >Next</A>
<!-- End Header -->
<A NAME="BABBJCFJ"></A><h1>Modifying source-controlled targets and objects</h1>
<A NAME="TI1066"></A><p>Objects in targets under source control must be managed differently
than the same objects in targets that are not under source control.</p>
<A NAME="TI1067"></A><h2>Effects of source control on object management</h2>
<A NAME="TI1068"></A><p>You must check out a target file from source control before
you can modify its properties. If objects in a source-controlled
target are not themselves registered in source control, you can
add them to or delete them from the local target without checking
out the target. However, you must remove a source-controlled
object from the source control system before you can delete the
same object from the local copy of the target (whether or not the
target itself is under source control).</p>
<A NAME="TI1069"></A><p>Although you can add objects to a source-controlled target
without checking out the target from source control, you cannot
add existing libraries to the library list of a source-controlled
target unless the target is checked out.</p>
<A NAME="TI1070"></A><p>For information on removing an object from source control,
see <A HREF="pbugp27.htm#BABDIHCF">"Removing objects from source
control"</A>.</p>
<A NAME="TI1071"></A><h2>Opening objects checked in to source control</h2>
<A NAME="TI1072"></A><p>Although you can open objects in a PowerBuilder painter when
they are checked in to source control, until you check them out
again, any changes you make to those objects cannot be saved. By
default, when you try to open an object under source control, PowerBuilder
provides a warning message to let you know when the object is not
checked out. You can avoid this type of warning message by clearing
the "Suppress prompts to overwrite read-only files" check
box on the Source Control tab of the Workspace Properties dialog box.</p>
<A NAME="TI1073"></A><p>If you did not change the default, you can still select a
check box on the first warning message that displays. After you
select the "Do not display this message again" check
box in a warning message box and click Yes, the check box on the
Source Control tab is automatically cleared. This prevents warning messages
from displaying the next time you open objects that are checked
in to source control. Although warning messages do not display,
you still cannot save any changes you make to these objects in a
PowerBuilder painter.</p>
<A NAME="TI1074"></A><h2>Copy and move operations on source-controlled objects</h2>
<A NAME="TI1075"></A><p>You cannot copy a source-controlled object to a destination <ACRONYM title = "pibble" >PBL</ACRONYM> in the same directory as the
source <ACRONYM title = "pibble" >PBL</ACRONYM>. Generally when you
work with source control, objects with the same name should not
exist in more than one <ACRONYM title = "pibble" >PBL</ACRONYM> in
the same directory. </p>
<A NAME="TI1076"></A><p>Moving an object that is not under source control to a destination <ACRONYM title = "pibble" >PBL</ACRONYM> having a source-controlled object
with the same name is permitted only when the second object is checked
out of source control.</p>
<A NAME="TI1077"></A><p>You cannot move an object from a source <ACRONYM title = "pibble" >PBL</ACRONYM> if
the object is under source control, even when the object has been
checked out. The right way to move an object under source control
is described below.</p>
<A NAME="TI1078"></A><p><img src="images/proc.gif" width=17 height=17 border=0 align="bottom" alt="Steps"> To move an object under source control from one <ACRONYM title = "pibble" >PBL</ACRONYM> to another:</p>
<ol><li class=fi><p>Export the object from the first <ACRONYM title = "pibble" >PBL</ACRONYM>.</p></li>
<li class=ds><p>Remove the object from source control.</p><p>See <A HREF="pbugp27.htm#BABDIHCF">"Removing objects from source
control"</A>.</p></li>
<li class=ds><p>Delete the object from the first <ACRONYM title = "pibble" >PBL</ACRONYM>.</p></li>
<li class=ds><p>Import the object into the second <ACRONYM title = "pibble" >PBL</ACRONYM>.</p></li>
<li class=ds><p>Register the object in source control once again.</p></li></ol>
<br><A NAME="BABCHHHJ"></A><h2>Editing the PBG file for a source-controlled target</h2>
<A NAME="TI1079"></A><p>PowerBuilder creates and uses PBG files to determine if any
objects present on a source control server are missing from local
PowerScript or .NET targets. Up-to-date PBG files insure that the
latest objects in source control are available to all developers
on a project, and that the objects are associated with a named <ACRONYM title = "pibble" >PBL</ACRONYM> file. </p>
<A NAME="TI1080"></A><p>Ideally, PBG files are not necessary. If the source control
system exposes the latest additions of objects in a project through
its SCC interface, PowerBuilder can obtain the list of all objects
added to a project since the last status refresh. However, many
source control systems do not support this, so PowerBuilder uses
the PBG files to make sure it has an up-to-date list of objects
under source control. </p>
<A NAME="TI1081"></A><p>PBG files are registered and checked in to source control
separately from all other objects in PowerBuilder. They are automatically
updated to include new objects that are added to source control,
but they can easily get out of sync when multiple users simultaneously
register objects to (or delete objects from) the same source control
project. For example, it is possible to add an object to source
control successfully yet have the check-in of the PBG file fail
because it is locked by another user.</p>
<A NAME="TI1082"></A><p>You cannot see the PBG files in the System Tree or Library
painter unless you set the root for these views to the file system.
To edit PBG files manually, you should check them out of source
control using the source control manager and open them in a text
editor. (If you are using PBNative, you can edit PBG files directly
in the server storage location, without checking them out of source control.)</p>
<A NAME="TI1083"></A><p>You can manually add objects to the PBG file for a PowerBuilder
library by including a new line for each object after the <FONT FACE="Courier New">@begin
Objects</FONT> line. The following is an example of
the contents of a PBG file for a <ACRONYM title = "pibble" >PBL</ACRONYM> that
is saved to a subdirectory (<i>target1</i>) of the
workspace associated with the source control project:</p>
<br><img src="images/gnapppbg.gif">

